<template>
  <el-image :src="src" class="img-container">
    <!-- 插槽,如果上传的图片出错,要显示的内容 -->
    <template slot="error">
      <img src="./head.jpg" alt="">
    </template>
  </el-image>
</template>

<script>
export default {
  name: 'ImageHolder',
  props: {
    src: {
      type: String,
      default: '' // 默认值
    }
  }
}
</script>

<style scoped lang="scss">
.img-container {
  border-radius: 50%

  img {
    width: 100%
  }
}
</style>
